#ifndef __CROSSFIRE_PARTICLES
#define __CROSSFIRE_PARTICLES

#define MAX_PARTICLES 200
#define RANDOM( x, y )(x + (y-x)*rand()/RAND_MAX)

const D3DXVECTOR3 EMPTY_VECTOR( 0.0f, 0.0f, 0.0f );

struct Vertex
{
  D3DXVECTOR3 Pos;
  D3DCOLOR    Color;

  enum FVF
  {
    FVF_Flags = D3DFVF_XYZ | D3DFVF_DIFFUSE
  };
};

struct SCF_Particle
{
  D3DXVECTOR3 Pos;
  D3DXVECTOR3 Vec;
  D3DCOLOR Color;
};

class CCF_Particles
{
private:
  SCF_Particle m_particles[ MAX_PARTICLES ];

  D3DXVECTOR3 m_direction;
  double m_slowCoeficient;
  double m_dropCoeficient;

  LPDIRECT3DDEVICE9 m_device;
  LPDIRECT3DTEXTURE9 m_texture;
  LPDIRECT3DVERTEXBUFFER9 m_vertexBuffer;

public:
  CCF_Particles(void);
  ~CCF_Particles(void);

  void Initialize( LPDIRECT3DDEVICE9 device, const WCHAR* texture );
  void Update( double time );
  void Render();
};

#endif